package com.sservice.web.controller.admin;

import com.sservice.model.vo.PurchaseOrderBillLogVo;
import com.sservice.service.service.PurchaseOrderBillLogService;
import com.sservice.base.entity.dto.ListResult;
import com.sservice.base.entity.dto.Pagination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("/admin/purchaseOrderBillLog/")
public class PurchaseOrderBillLogController {

    @Autowired
    private PurchaseOrderBillLogService serviceLog;

    @ResponseBody
    @RequestMapping(value = "/query", method = RequestMethod.GET)
    public ListResult query(PurchaseOrderBillLogVo arg, HttpSession session) {

        List<PurchaseOrderBillLogVo> list_order = serviceLog.queryByPage(arg);
        int total = serviceLog.queryCount(arg);
        Pagination page = new Pagination(arg.getPage(), total, arg.getSize());
        ListResult res = new ListResult(true, list_order);
        res.setPage(page);
        return res;
    }
}